﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SelectItem.aspx.cs" Inherits="YhmOA.Commons.SelectItem" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <link type="text/css" rel="Stylesheet" href="../Styles/Common.css" />
    <script type="text/javascript" src="../Scripts/jquery-1.4.1.min.js"></script>
    <script type="text/javascript" src=""></script>
    <script type="text/javascript">
        function ExecReturnValue() {
            var result = GetReturnValue();
            if (result != "") {
                var CallFun = GetCallFun();
                window.parent.eval(CallFun + "('" + result + "');");
                window.parent.$("#CloseSelectItem").click();
            }
            else {
                PageLoad();
            }
        }
        $(function () {
            PageLoad();
        });
        function PageLoad()
        {
            $(".ItemChk").each(function () {
                $(this).mouseover(function () {
                    $(this).parent().parent().attr("aaa", "aaa");
                    $(this).css("cursor", "pointer");
                }).mouseout(function () {
                    $(this).parent().parent().removeAttr("aaa");
                });
                $(this).parent().parent().mouseover(function () {
                    $(this).css("background", "#DAEBF6").css("cursor", "pointer");
                }).mouseout(function () {
                    $(this).css("background", "White")
                }).click(function () {
                    if ($(this).attr("aaa") == "undefined" || $(this).attr("aaa") == undefined || $(this).attr("aaa") == null || $(this).attr("aaa") == "") {
                        $(this).children().children(".ItemChk").attr("checked", $(this).children().children(".ItemChk").attr("checked") == true ? false : true);
                    }
                });
            });
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <table width="100%" cellpadding="5" cellspacing="0">
        <tr>
            <td width="80px">
            <input type="button" class="Button" id="btnSearch" name="btnSearch" onclick="ExecReturnValue();" value="确定选择" /></td>
            <td><asp:TextBox ID="txt_Search" CssClass="TextBox" style="height:22px; line-height:22px;" notAjaxRender="notAjaxRender" onkeyup="GetSource();PageLoad();" runat="server"></asp:TextBox></td>
        </tr>
    </table>
    <asp:GridView ID="gvShow" runat="server" Width="100%" EmptyDataText="暂无数据..." 
        CssClass="Table" onrowdatabound="gvShow_RowDataBound">
        <Columns>
            <asp:TemplateField>
                <HeaderTemplate>选择</HeaderTemplate>
                <ItemTemplate>
                    <input id="ItemChk" class="ItemChk" name="ItemChk" type="checkbox" value='<%#Eval("Id") %>' /></ItemTemplate>
                <ItemStyle Width="40px" />
            </asp:TemplateField>
        </Columns>
        <HeaderStyle CssClass="th" />
        <RowStyle CssClass="td" />
    </asp:GridView>
    </form>
</body>
</html>
